﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QuanLyThuVien.DTO;
using QuanLyThuVien.DAO;
using System.Data;
using System.Windows.Forms;

namespace QuanLyThuVien.BUS
{
    class SachBUS
    {
        public static void SuaSoLuong(SachDTO s)
        {
            SachDAO.SuaSoLuong(s);
        }
        public static DataTable XuLyMuon_Sach(int MaSach)
        {
            return SachDAO.XuLyMuon_Sach(MaSach);
        }
        public static DataTable danhsachsach(int masach)
        {
            return SachDAO.laydanhsachsach(masach);
        }
    


        //trung
        public static DataGridView GetAllS()
        {
            return SachDAO.GetAllS();
        }

      

        public static void Them(Sach S)
        {
            SachDAO.Them(S);
        }

        public static void Xoa(Sach S)
        {
            SachDAO.Xoa(S);
        }

        public static void Sua(Sach S)
        {
            SachDAO.Sua(S);
        }

        public static DataGridView GetMaSach(string TenSach)
        {
            return SachDAO.GetMaSach(TenSach);
        }

        public static DataGridView GetMaSachInCTPM(string TenSach)
        {
            return SachDAO.GetMaSachInCTPM(TenSach);
        }

        public static void GiamSoLuong(int MaSach, int SoLuong)
        {
            SachDAO.GiamSoLuong(MaSach, SoLuong);
        }

        public static DataGridView GetSoLuong(int MaSach)
        {
            return SachDAO.GetSoLuong(MaSach);
        }

        public static void TangSoLuong(int MaSach, int SoLuong)
        {
            SachDAO.TangSoLuong(MaSach, SoLuong);
        }

        // lay ra thong tin sach
        public static Sach ThongTin_Sach(int ma)
        {
            return SachBUS.ThongTin_Sach(ma);
        }


        //phat huy
        public static DataTable Tim_Kiem_Sach(string ts, string tg, string tl, string nsx)
        {
            return SachDAO.Tim_Kiem_Sach(ts, tg, tl, nsx);
        }

        //kiem tra sach co hay chua
        public static int KT_Sach(string tenSach, string tenTG)
        {
            return SachDAO.KT_Sach(tenSach, tenTG);
        }
   
    }
}
